package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.constant.ServiceOfferConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalKeyConsts;
import com.iwhalecloud.bss.kite.cucc.service.attr.LocalAttrCalcFeeUtil;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.ModelAttrHandler;
import com.iwhalecloud.bss.kite.cucc.service.util.ProdCateUtil;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.api.IOperateSceneInstService;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.manager.inst.KiteProdInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.scene.attr.OperateInstAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
* @Description: 型号属性联动处理类
*
* @author lyx
* @date 2021年3月15日
* @version V1.0
* @Package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler
*/
@Service
@AttrHandler(ModelAttrHandler.class)
public class ModelAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {

    @Autowired
    IQuerySceneInstService querySceneInstService;

    @Autowired
    OperateInstAttrService operateInstAttrService;

    @Autowired
    private IOperateSceneInstService operateSceneInstService;


    private static Map<String, String> sellingPrice = null;//销售价
    private static Map<String, String> settlePrice = null;//结算价
    private static Map<String, String> fairPrice = null;//公允价
    private static Map<String, String> materialCode = null;//物资编码
    private static Map<String, String> videoSellingPrice = null;//雁飞视频监控套件-云存储销售价
    private static Map<String, String> videoSettlePrice = null;//雁飞视频监控套件-云存储结算价

    static {
        sellingPrice = new HashMap<>();
        sellingPrice.put("110007359" ,"1248.5");//雁飞工业网关W001
        sellingPrice.put("110007360" ,"2498.1");//雁飞工业网关W002
        sellingPrice.put("110007361" ,"950.4");//雁飞工业网关L001
        sellingPrice.put("110007362" ,"1450.9");//雁飞工业网关L002
        sellingPrice.put("110007363" ,"1200.1");//雁飞工业网关L001-U
        sellingPrice.put("110007364" ,"300.3");//雁飞工业网关L001P
        sellingPrice.put("110007365" ,"994.4");//雁飞工业网关L002P
        sellingPrice.put("110007366" ,"1500.4");//雁飞工业网关L001P-U
        sellingPrice.put("110007367" ,"1244.1");//雁飞工业DTU-LD4001
        sellingPrice.put("110007368" ,"344.3");//雁飞工业DTU-LD4001P

        settlePrice = new HashMap<>();
        settlePrice.put("110007359" ,"1135");//雁飞工业网关W001
        settlePrice.put("110007360" ,"2271");//雁飞工业网关W002
        settlePrice.put("110007361" ,"864");//雁飞工业网关L001
        settlePrice.put("110007362" ,"1319");//雁飞工业网关L002
        settlePrice.put("110007363" ,"1091");//雁飞工业网关L001-U
        settlePrice.put("110007364" ,"273");//雁飞工业网关L001P
        settlePrice.put("110007365" ,"904");//雁飞工业网关L002P
        settlePrice.put("110007366" ,"1364");//雁飞工业网关L001P-U
        settlePrice.put("110007367" ,"1131");//雁飞工业DTU-LD4001
        settlePrice.put("110007368" ,"313");//雁飞工业DTU-LD4001P

        fairPrice = new HashMap<>();
        fairPrice.put("110007359" ,"1135");//雁飞工业网关W001
        fairPrice.put("110007360" ,"2271");//雁飞工业网关W002
        fairPrice.put("110007361" ,"864");//雁飞工业网关L001
        fairPrice.put("110007362" ,"1319");//雁飞工业网关L002
        fairPrice.put("110007363" ,"1091");//雁飞工业网关L001-U
        fairPrice.put("110007364" ,"273");//雁飞工业网关L001P
        fairPrice.put("110007365" ,"904");//雁飞工业网关L002P
        fairPrice.put("110007366" ,"1364");//雁飞工业网关L001P-U
        fairPrice.put("110007367" ,"1131");//雁飞工业DTU-LD4001
        fairPrice.put("110007368" ,"313");//雁飞工业DTU-LD4001P

        materialCode = new HashMap<>();
        materialCode.put("110007359" ,"7600301196");//雁飞工业网关W001
        materialCode.put("110007360" ,"7600301199");//雁飞工业网关W002
        materialCode.put("110007361" ,"7600301189");//雁飞工业网关L001
        materialCode.put("110007362" ,"7600301190");//雁飞工业网关L002
        materialCode.put("110007363" ,"7600301201");//雁飞工业网关L001-U
        materialCode.put("110007364" ,"7600301186");//雁飞工业网关L001P
        materialCode.put("110007365" ,"7600301192");//雁飞工业网关L002P
        materialCode.put("110007366" ,"7600301194");//雁飞工业网关L001P-U
        materialCode.put("110007367" ,"7600301193");//雁飞工业DTU-LD4001
        materialCode.put("110007368" ,"7600301191");//雁飞工业DTU-LD4001P

    }

    @Override
    public void handle(KiteAttr attr, KiteInst inst, AttrData data) {
        /**
         * 主产品的型号子产品、附件产品的型号同时修改
         */
        if (KiteStringUtils.equalsAny(inst.getSpecId(), "30000003","30000012","30004000","30000002", "30000005","30000011","63249595")) {
            String offerInstId = querySceneInstService.getSceneInst(data.getSceneInstId()).getRootInstId();
            // KiteOfferInst kiteOfferInst = querySceneInstService.getOfferInst(data.getCustId(), offerInstId);
            List<KiteProdInst> prodInstList = querySceneInstService.listProdInstsFromGiftOfferInst(data.getCustId(),
                offerInstId);
            prodInstList.forEach(prodInst -> {
                if (KiteStringUtils.equals(inst.getInstId(), prodInst.getInstId()) || Objects
                    .isNull(prodInst.getAttr("200002772"))) {
                    return;
                }
                if (KiteStringUtils.equalsAny(prodInst.getSpecId(), "50000020")) {
                    return;
                }
                String value = getModelValue(attr.getValue());
//                List<KiteProdInstFunc> prodFuncList = querySceneInstService.listProdInstFuncs(data.getCustId(), prodInst.getInstId());
//                prodFuncList.forEach(prodFunc -> {
//                    KiteAttr kiteAttr = prodFunc.getAttr("200002772");
//                    if (Objects.nonNull(kiteAttr)) {
//                        operateInstAttrService.setAttrValue(prodFunc, "200002772", value,
//                            data.getSceneInstId(), null);
//                    }
//                });
                operateInstAttrService.setAttrValue(prodInst, "200002772", value,
                    data.getSceneInstId(), null);
            });
        }

        /**
         * 物资编码根据型号联动：
         */
        if (Objects.nonNull(inst.getAttr("200004178"))) {
            String value = null;
            if (KiteStringUtils.equals(inst.getSpecId(), "50000043")) { // I型Cat1电力模块
                /**
                 * HXMTYYJ137（HX-I-CAT1）110007197：7600300887
                 * WFGM-700（WS-I-CAT1）110007198：7600300888
                 */
                if (KiteStringUtils.equals(attr.getValue(), "110007197")) {
                    value = "7600300887";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007198")) {
                    value = "7600300888";
                }
            }
            else if (KiteStringUtils.equals(inst.getSpecId(), "50000037")) { // 备网终端
                /**
                 * 型号联动物资编码 7600300191（备网001） ,7600300233（备网002）,7600300191（备网003）
                 */
                if (KiteStringUtils.equals(attr.getValue(), "110007192")) {
                    value = "7600300191";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007193")) {
                    value = "7600300233";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007194")) {
                    value = "7600300191";
                }
            }
            else {
                if (KiteStringUtils.equals(attr.getValue(), "110007021")
                    || KiteStringUtils.equals(attr.getValue(), "110007028")) {
                    value = "7633300357";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007023")
                    || KiteStringUtils.equals(attr.getValue(), "110007029")) {
                    value = "7600300820";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007024")
                    || KiteStringUtils.equals(attr.getValue(), "110007030")) {
                    value = "7600300818";
                }
                /*else if (KiteStringUtils.equals(attr.getValue(), "110007212")) {
                    value = "7600301426";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007213")) {
                    value = "7600301425";
                }
                else if (KiteStringUtils.equals(attr.getValue(), "110007357")) {
                    value = "7600301424";
                }*/
            }

            if (KiteStringUtils.isNotEmpty(value)) {
                operateInstAttrService.setAttrValue(inst, "200004178", value,
                    data.getSceneInstId(), null);
            }
        }

        String model = attr.getValue();
        String serviceTime = inst.getAttrValue("200004106");//产品服务期限
        if (KiteStringUtils.isNotBlank(model) && KiteStringUtils.isNotBlank(serviceTime)) {
            if (KiteStringUtils.equals(inst.getSpecId(), "30000007")) {
                LocalAttrCalcFeeUtil.calculatePrice(model, serviceTime, inst, data.getSceneInstId(), true);
            }
            else if (KiteStringUtils.equals(inst.getSpecId(), "50000037")) {
                LocalAttrCalcFeeUtil.calculatePrice(model, serviceTime, inst, data.getSceneInstId(), false);
            }
        }
        String extParam = querySceneInstService.getExtParameterValue(data.getSceneInstId(), "entry");

        //        if ("sceneTempl".equals(data.getExtAttributes().get("entry")) || "sceneTempl".equals(extParam)) {
        //            return;
        //        }
        if (!ServiceOfferConsts.SERVICE_OFFER_ORDER.equals(data.getServiceOfferId())
            && !KeyConsts.IFTRUE_T.equals(querySceneInstService.getExtParameterValue(data.getSceneInstId(), LocalKeyConsts.BUSI_CHANGE_SCENE))) {
            return;
        }
        // 雁飞4G应急广播大喇叭框架产品
        if (KiteStringUtils.isEqual(inst.getSpecId(), ProdCateUtil.getMainMemberProdId(ProdCateUtil.GIFT_YJGB_PROD))) {
            // 乡村号角
            if (KiteStringUtils.isEqual(model,"110007195")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "3199",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "2699",
                    data.getSceneInstId(), null);
            }
            // 城镇音柱
            else if (KiteStringUtils.isEqual(model,"110007196")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "2899",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "2499",
                    data.getSceneInstId(), null);
            }
            //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
            inst.listAttrs().stream().forEach(kiteAttr -> {
                if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                    kiteAttr.setDefaultValue(kiteAttr.getValue());
                }
            });
        }
        // 5G CPE框架产品
        if (KiteStringUtils.isEqual(inst.getSpecId(), ProdCateUtil.getMainMemberProdId(ProdCateUtil.GIFT_YFCPE_PROD))) {
            // ZLT X21
            if (KiteStringUtils.isEqual(model,"110010175")) {
                //销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "1999",
                        data.getSceneInstId(), null);
                //结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "1700",
                        data.getSceneInstId(), null);
            }else{
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "999",
                        data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "939",
                        data.getSceneInstId(), null);
            }
        }

        // 物联网云章监控套件框架产品
        if (KiteStringUtils.isEqual(inst.getSpecId(), "30000005")) {
            // 标准版
            if (KiteStringUtils.isEqual(model,"110007193")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "3999",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "2700",
                    data.getSceneInstId(), null);
            }
            // 增强版
            else if (KiteStringUtils.isEqual(model,"100000200")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "4399",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "2980",
                    data.getSceneInstId(), null);
            }
            //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
            inst.listAttrs().stream().forEach(kiteAttr -> {
                if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                    kiteAttr.setDefaultValue(kiteAttr.getValue());
                }
            });
        }
        //云章终端
        if (KiteStringUtils.isEqual(inst.getSpecId(), "50000032")) {
            // 标准版
            if (KiteStringUtils.isEqual(model,"110007193")) {
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "2700",
                    data.getSceneInstId(), null);
            }
            // 增强版
            else if (KiteStringUtils.isEqual(model,"100000200")) {
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "2980",
                    data.getSceneInstId(), null);
            }
        }
        // 云章应用管理平台
        if (KiteStringUtils.isEqual(inst.getSpecId(), "50000033")) {
            // 标准版
            if (KiteStringUtils.isEqual(model,"110007193")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "720",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "650",
                    data.getSceneInstId(), null);
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "2700",
                    data.getSceneInstId(), null);
            }
            // 增强版
            else if (KiteStringUtils.isEqual(model,"100000200")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "800",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "720",
                    data.getSceneInstId(), null);
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "2980",
                    data.getSceneInstId(), null);
            }
            //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
            inst.listAttrs().stream().forEach(kiteAttr -> {
                if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                    kiteAttr.setDefaultValue(kiteAttr.getValue());
                }
            });
        }

        // 2.物联网NB室温采集框架产品 智能烟感1
        if (KiteStringUtils.equalsAny(inst.getSpecId(), "30000017", "30000003")) {
            // NB室温采集终端（丰源-插座型）
            if (KiteStringUtils.isEqual(model,"110007200")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "260",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "280",
                    data.getSceneInstId(), null);
            }
            // NB室温采集终端（丰源-开关型）
            else if (KiteStringUtils.isEqual(model,"110007201")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "230",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "250",
                    data.getSceneInstId(), null);
            }
            else if (KiteStringUtils.equalsAny(model, "110007212", "110007213", "110007357")) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", "184",
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", "143",
                    data.getSceneInstId(), null);
            }
            //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
            inst.listAttrs().stream().forEach(kiteAttr -> {
                if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                    kiteAttr.setDefaultValue(kiteAttr.getValue());
                }
            });
        }

        // 物联网NB室温采集终端
        if (KiteStringUtils.isEqual(inst.getSpecId(), "50000046")) {
            // NB室温采集终端（丰源-插座型）
            if (KiteStringUtils.isEqual(model,"110007200")) {
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "230",
                    data.getSceneInstId(), null);
                // 物资编码
                operateInstAttrService.setAttrValue(inst, "200004178", "7600301205",
                    data.getSceneInstId(), null);

            }
            // NB室温采集终端（丰源-开关型）
            else if (KiteStringUtils.isEqual(model,"110007201")) {
                // 产品公允价
                operateInstAttrService.setAttrValue(inst, "200004115", "250",
                    data.getSceneInstId(), null);
                // 物资编码
                operateInstAttrService.setAttrValue(inst, "200004178", "7600301206",
                    data.getSceneInstId(), null);
            }
        }

        // 雁飞工业网关
        if (KiteStringUtils.isEqual(inst.getSpecId(), "30000020")) {
            String offerInstId = querySceneInstService.getSceneInst(data.getSceneInstId()).getRootInstId();
            List<KiteProdInst> prodInstList = querySceneInstService.listProdInstsFromGiftOfferInst(data.getCustId(), offerInstId);
            KiteProdInst kiteProdInst = prodInstList.stream().filter(prodInst -> "50000050".equals(prodInst.getSpecId())).findFirst().orElse(null);
            if (sellingPrice.containsKey(model)) {
                // 标准销售价
                operateInstAttrService.setAttrValue(inst, "200004107", sellingPrice.get(model),
                    data.getSceneInstId(), null);
                // 标准结算价
                operateInstAttrService.setAttrValue(inst, "200004108", settlePrice.get(model),
                    data.getSceneInstId(), null);
                //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
                inst.listAttrs().stream().forEach(kiteAttr -> {
                    if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                        kiteAttr.setDefaultValue(kiteAttr.getValue());
                    }
                });
                if (Objects.nonNull(kiteProdInst)) {
                    KiteAttr prodModelAttr = kiteProdInst.getAttr("200002772");  // 型号
                    if (Objects.nonNull(prodModelAttr)) {
                        prodModelAttr.setValue(attr.getValue());
                        prodModelAttr.setValueDesc(attr.getValueDesc());
                        operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), prodModelAttr);
                    }
                    KiteAttr prodFairnessAttr = kiteProdInst.getAttr("200004115");  // 产品公允价
                    if (Objects.nonNull(prodFairnessAttr)) {
                        prodFairnessAttr.setValue(fairPrice.get(model));
                        prodFairnessAttr.setValueDesc(fairPrice.get(model));
                        operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), prodFairnessAttr);
                    }
                    KiteAttr materialCodeAttr = kiteProdInst.getAttr("200004178");  //物资编码
                    if (Objects.nonNull(materialCodeAttr)) {
                        materialCodeAttr.setValue(materialCode.get(model));
                        materialCodeAttr.setValueDesc(materialCode.get(model));
                        operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), materialCodeAttr);
                    }
                }
            }
        }
        // 雁飞智能烟感2
        if (KiteStringUtils.isEqual(inst.getSpecId(), "30000021")) {
            // 标准销售价
            operateInstAttrService.setAttrValue(inst, "200004107", "200",
                data.getSceneInstId(), null);
            // 标准结算价
            operateInstAttrService.setAttrValue(inst, "200004108", "159",
                data.getSceneInstId(), null);
            //给标准结算价赋默认值，方便规则中心判断是否需要上传oop
            inst.listAttrs().stream().forEach(kiteAttr -> {
                if (KiteStringUtils.isEqual(kiteAttr.getFieldName(),"200004108")){
                    kiteAttr.setDefaultValue(kiteAttr.getValue());
                }
            });
            String offerInstId = querySceneInstService.getSceneInst(data.getSceneInstId()).getRootInstId();
            List<KiteProdInst> prodInstList = querySceneInstService.listProdInstsFromGiftOfferInst(data.getCustId(), offerInstId);
            KiteProdInst kiteProdInst = prodInstList.stream().filter(prodInst -> "50000308".equals(prodInst.getSpecId())).findFirst().orElse(null);//烟感终端2
            if (Objects.nonNull(kiteProdInst)) {
                KiteAttr prodModelAttr = kiteProdInst.getAttr("200002772");  // 型号
                if (Objects.nonNull(prodModelAttr)) {
                    prodModelAttr.setValue(attr.getValue());
                    prodModelAttr.setValueDesc(attr.getValueDesc());
                    operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), prodModelAttr);
                }
                KiteAttr prodFairnessAttr = kiteProdInst.getAttr("200004115");  // 产品公允价
                if (Objects.nonNull(prodFairnessAttr)) {
                    prodFairnessAttr.setValue("136");
                    prodFairnessAttr.setValueDesc("136");
                    operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), prodFairnessAttr);
                }
                KiteAttr materialCodeAttr = kiteProdInst.getAttr("200004178");  //物资编码，1021版本调整为空
                if (Objects.nonNull(materialCodeAttr)) {
                    materialCodeAttr.setValue("");
                    materialCodeAttr.setValueDesc("");
                    operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst.getInstType(), kiteProdInst.getInstId(), materialCodeAttr);

                }
            }
            KiteProdInst kiteProdInst1 = prodInstList.stream().filter(prodInst -> "50000083".equals(prodInst.getSpecId())).findFirst().orElse(null);//烟感管理平台2
            if (Objects.nonNull(kiteProdInst1)) {
                KiteAttr materialCodeAttr1 = kiteProdInst1.getAttr("200004178");  //物资编码，1021版本调整为空
                if (Objects.nonNull(materialCodeAttr1)) {
                    materialCodeAttr1.setValue("");
                    materialCodeAttr1.setValueDesc("");
                    operateSceneInstService.setAttr(data.getSceneInstId(), kiteProdInst1.getInstType(), kiteProdInst1.getInstId(), materialCodeAttr1);

                }
            }
        }
    }

    @Override
    public void handleStyle(KiteAttr attr, KiteInst inst, AttrData data) {

    }

    private String getModelValue(String value) {
        String modelValue = value;
        if (KiteStringUtils.equals(value, "110007028")) {
            modelValue = "110007021"; //TG001
        }else if (KiteStringUtils.equals(value, "110007029")) {
            modelValue = "110007023"; //TG002
        }else if (KiteStringUtils.equals(value, "110007030")) {
            modelValue = "110007024"; //TG003
        }else if (KiteStringUtils.equals(value, "110007357")) {
            modelValue = "110007357"; //(雁飞智能烟感-006)
        }else if (KiteStringUtils.equals(value, "110007213")) {
            modelValue = "110007213"; //(雁飞智能烟感-002)
        }else if (KiteStringUtils.equals(value, "110007212")) {
            modelValue = "110007212"; //(雁飞智能烟感-001)
        }else if (KiteStringUtils.equals(value, "110007196")) {
            modelValue = "110007196";
        }else if (KiteStringUtils.equals(value, "110007195")) {
            modelValue = "110007195";
        }
        return modelValue;
    }

}
